package com.dcy.common.enums;

import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Author dcy
 * @Description: 工作流枚举
 * @Date: 2021/12/20
 */
@AllArgsConstructor
@Getter
public enum TaskTypeEnum {

    /**
     * 审批流程
     */
    LEAVE("leave", "审批流程", "leaveService"),


    ;


    /**
     * 业务类型
     */
    private final String businessType;

    /**
     * 描述
     */
    private final String info;

    /**
     * service bean名称
     */
    private final String serviceName;


    public static TaskTypeEnum getByCode(String code) {
        if (StrUtil.isBlank(code)) {
            return null;
        }
        for (TaskTypeEnum enums : TaskTypeEnum.values()) {
            if (enums.getBusinessType().equals(code)) {
                return enums;
            }
        }
        return null;
    }
}
